<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>
<font size="-1">component-family:</font> javax.faces.OutcomeTarget <font size="-1">renderer-type:</font> javax.faces.Button
</title>
<link REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
</head>
<script>
function asd()
{
  parent.document.title=<font size="-1">component-family:</font> javax.faces.OutcomeTarget <font size="-1">renderer-type:</font> javax.faces.Button
}
</SCRIPT>
<body BGCOLOR="white" onload="asd();">

<H2><font size="-1">HTML_BASIC render-kit</font>
<br />
<font size="-1">component-family:</font> javax.faces.OutcomeTarget <font size="-1">renderer-type:</font> javax.faces.Button
</H2>
<HR />
<P>

<p><span class="changed_modified_2_1">Render a button that does not
cause an HTTP POST.</span></p>

<div class="changed_added_2_0"><div class="changed_modified_2_1">
 
      <p>Encode Behavior</p>

<p>Render an HTML "input" element of type "button".  The value of the
component is rendered as the button text and the outcome of the
component is used to determine the target URL which is activated by
onclick.  If "image" attribute is specified, render it as the value of
the "src" attribute after passing it to the
<code>getResourceURL()</code> method of the <code>ViewHandler</code> for
this application, and passing the result through the
<code>encodeResourceURL()</code> method of the
<code>ExternalContext</code>.</p>

<p>If the component is not disabled, take the following actions.</p>

  <p><a name="UIOutcomeTargetGetEncodedTargetUrl">Algorithm to obtain the url to which the user-agent should issue a GET request when clicked</a></p>

  <p>Obtain the <code>NavigationCase</code> that corresponds to the
  component instance for this <code>Renderer</code>.</p>

  <p>Obtain an instance of
  <code>javax.faces.application.ConfigurableNavigationHandler</code> from
  the <code>ViewHandler</code>.  If no such instance can be obtained,
  write the "disabled" attribute on the button.  Otherwise, let
  <em>outcome</em> be the result of calling <code>getOutcome()</code> on
  the argument component, which must be an instance of
  <code>UIOutcomeTarget</code>.  If this result is <code>null</code>, let
  <em>outcome</em> be the viewId of the current <code>UIViewRoot</code>.
  Let <em>navCase</em> be the return from calling
  <code>getNavigationCase()</code> on the
  <code>ConfigurableNavigationHandler</code>, passing the current
  <code>FacesContext</code> as the first argument, <code>null</code>, as
  the second argument, and <em>outcome</em> as the third argument.  If
  this returns <code>null</code>, log an informative error which includes
  the component id, and write the "disabled" attribute on the component
  markup, with the value of <code>true</code>.  Otherwise obtain the
  encoded target URL using the following algorithm.</p>

  <p>Algorithm to obtain the encoded target URL</p>

  <ul>

	  <li><p>Let <em>params</em> be the <code>Map&lt;String,
	  List&lt;String&gt;&gt;</code> to be passed to
	  <code>ViewHandler.getBookmarkableURL()</code>.  Build this map up first
	  from any child <code>UIParameter</code> components.  These children must
	  be processed in the order in which they appear as children.  If multiple
	  children with the same name are encountered, their values must appear in
	  the <code>List&lt;String&gt;</code> in the <code>Map</code> entry with
	  the same name, and appear in the list in the same order as their child
	  order.</p></li>

	  <li><p>Next, obtain any parameters included within the
	  navigation case.  Call <code>getParameters()</code> on
	  <em>navCase</em>.  The result will be a <code>Map&lt;String,
	  List&lt;String&gt;&gt;</code>.  If the result is
	  non-<code>null</code> and non-empty, iterate over the entries
	  from the result <code>Map</code> and, if no entry with the
	  same name exists in <em>params</em>, set the value from the
	  current entry as the value in the <em>params</em>
	  <code>Map</code>.</p></li>

	  <li><p>Let <em>includeViewParams</em> be the result of a
	  logical OR of the results from calling
	  <code>isIncludeViewParams()</code> on the argument
	  <code>UIOutcomeTarget</code> component and calling
	  <code>isIncludeViewParams</code> on <em>navCase</em>.</p></li>


	  <li><p>Call <code>getBookmarkableURL()</code> on the
	  <code>ViewHandler</code>, passing the current
	  <code>FacesContext</code> as the first argument, the return
	  from calling <code>getToViewId()</code> as the second
	  argument, <em>params</em> as the third argument, and
	  <em>includeViewParams</em> as the last argument.</p></li>

  </ul>

  <p>The entire target URL string must be passed through a call to
  the <code>encodeResourceURL()</code> method of the
  <code>ExternalContext</code>.  The name of the
  <code>UIParameter</code> goes on the left hand side, and the value of
  the <code>UIParameter</code> on the right hand side.  The name and the
  value must be URLEncoded.  Each <code>UIParameter</code> instance is
  separeted by an ampersand, as dictated in the URL spec.  The final
  encoded result will be written out to the onclick attribute of the
  button as "window.location.href = '<encoded HREF value>'".  If the
  developer has specified a custom onlclick the window.location.href
  name/value pair will be appended at the end of the developer specified
  script.  If the "fragment" attribute is specified, the value will be
  included at the end of the resulting URL preceded by a hash mark.  If
  the "styleClass" attribute is specified, render its value as the value
  of the "class" attribute.  If the "id" attribute is specified, follow
  the same steps as mentioned in the "<a
  href="renderkit-summary.html#general_encoding">General
  Notes on Encoding</a>" regarding the "id" attribute for UIInput
  components.  If the "disabled" attribute is specified, do not render
  the "onclick" element and assign the "disabled" attribute a value of
  true.</p>

</div></div></P>
<P>This renderer is responsible for rendering its children.</P><HR />
<a NAME="attributes"><!-- --></a>

<h3>Note:</h3>

<p>Attributes with a <code>pass-through</code> value of
<code>true</code> are not interpreted by the renderer and are passed
straight through to the rendered markup, without checking for validity.  Attributes with a
<code>pass-through</code> value of <code>false</code> are interpreted
by the renderer, and may or may not be checked for validity by the renderer.</p>

<table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td COLSPAN="5"><font SIZE="+2">
<b>Attributes</b></font></td>
</tr>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<th><b>attribute-name</b></th>
<th><b>pass-through</b></th>
<th><b>attribute-class</b></th>
<th><b>description</b></th>
<th><b>default-value</b></th>
</tr>
	    
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;accesskey
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Access key that, when pressed, transfers focus
          to this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;alt
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
        Alternate textual description of the
        element rendered by this component.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;dir
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Direction indication for text that does not inherit directionality.
          Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;fragment
</td>
<td ALIGN="right" VALIGN="top">false</td>
<td><code>java.lang.String</code></td>
<td>
          The identifier of the page fragment which should
          be brought into focus when the target page is
          rendered. The value of this attribute is appended
          to the end of target URL following a hash (#) mark.
          This notation is part of the standard URL syntax.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;image
</td>
<td ALIGN="right" VALIGN="top">false</td>
<td><code>java.lang.String</code></td>
<td><p>
        Absolute or relative URL of the
        image to be displayed for this
        button.  If specified, this
        "input" element will be of type
        "image".  Otherwise, it will be
        of the type specified by the
        "type" property with a label
        specified by the "value"
        property.  <span
        class="changed_added_2_0">Note
        that if the value of this
        attribute starts with "/", the
        rendered value for this
        attribute will be prefixed with
        the context-root for this
        application.</span>
      </p></td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;lang
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Code describing the language used in the generated markup
          for this component.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onblur
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when this element loses focus.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onclick
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          clicked over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;ondblclick
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          double clicked over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onfocus
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when this element receives focus.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onkeydown
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a key is
          pressed down over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onkeypress
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a key is
          pressed and released over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onkeyup
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a key is
          released over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onmousedown
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          pressed down over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onmousemove
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          moved within this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onmouseout
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          moved away from this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onmouseover
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          moved onto this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;onmouseup
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Javascript code executed when a pointer button is
          released over this element.</td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;style
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          CSS style(s) to be applied when this component is rendered.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;styleClass
</td>
<td ALIGN="right" VALIGN="top">false</td>
<td><code>java.lang.String</code></td>
<td>
          Space-separated list of CSS style class(es) to be applied when
          this element is rendered.  This value must be passed through
          as the "class" attribute on generated markup.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;tabindex
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Position of this element in the tabbing order
          for the current document.  This value must be
          an integer between 0 and 32767.
        </td>
<td>undefined<td>
</tr>
<tr BGCOLOR="white" CLASS="TableRowColor">
<td ALIGN="right" VALIGN="top" WIDTH="1%"><code>
&nbsp;title
</td>
<td ALIGN="right" VALIGN="top">true</td>
<td><code>java.lang.String</code></td>
<td>
          Advisory title information about markup elements generated
          for this component.</td>
<td>undefined<td>
</tr>
</table>
<hr>
Copyright (c) 2003-2010 Oracle America, Inc. All Rights Reserved.
</body>
</html>
